package com.example.pertecttime.api;

import android.content.Context;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by 半生瓜 on 2017/7/23.
 */

public class CookiesInterceptor implements Interceptor {
    private Context context;


    //重写拦截方法，处理自定义的Cookies信息
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
        Request compressedRequest = request.newBuilder()
                .header("token", "asdasda")
                .build();
        Response response = chain.proceed(compressedRequest);
        return response;
    }
}
